#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>


static void sig_ign2(int singo) {
	printf("pid=%d, received signal %d,ignore\n", getpid(), singo);
}

int main(void) {
	signal(SIGINT, sig_ign2);
	// signal(SIGINT, SIG_IGN);

	pid_t pid;
	if ((pid = fork()) == 0) {
		printf("child pid=%d\n", getpid());
		execl("./abc", 0);
		// exit(0);
	} else {
		printf("parent pid=%d\n", getpid());
	}
	wait(0);
	sleep(10);
	puts("aaaaaaaa");
	sleep(10);
	puts("parent end");
	return 0;
}

// not understanded
// http://stackoverflow.com/questions/32708086/ignoring-signals-in-parent-process

// gcc abc.c -o abc  && gcc exec_signal.c
// ./a.out